using System;
#if !HC2020
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
using Acap = Autodesk.AutoCAD.ApplicationServices.Application;
using Acap1 = Autodesk.AutoCAD.ApplicationServices.Application;
using Acap2 = Autodesk.AutoCAD.ApplicationServices.Application;
using Autodesk.AutoCAD.Geometry;
#else

using GrxCAD.DatabaseServices;
using GrxCAD.EditorInput;
using GrxCAD.Geometry;
using GrxCAD.ApplicationServices;
using GrxCAD.Runtime;
using GrxCAD.Colors;
using GrxCAD.GraphicsInterface;
using Viewport = GrxCAD.DatabaseServices.Viewport;
#endif
using Newtonsoft.Json;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization;
using System.Linq;

namespace JoinBox.试验库2222
{
    // 用于ADSRX库函数输入参数的类型（AcedCmd）
    // 用于通过接口 AcedInvoke 定义lisp
    // https://forums.autodesk.com/t5/net/autocad-2013-accoreconsole-acadevaluatelisp/td-p/3695768
    // 本枚举融合 Autodesk.AutoCAD.Runtime.LispDataType
    //           Autodesk.AutoCAD.EditorInput.PromptStatus
    namespace JoinBox.Config.Json.DynamicAssembly
    {
        public class CadCmdItem
        {
            public string 命令 { get; set; }
            public string 块名称 { get; set; }
            public int 屏幕点击 { get; set; }
            public short 颜色 { get; set; }
            public string 图层 { get; set; }
            public bool 缩放 { get; set; }
            public bool 镜像 { get; set; }

            //此构造写入了动态编译内字符串,若要修改,请一同修改.
            //所有参数写string类型是为了动态编译ToString的时候接收
            public CadCmdItem(string 块名称, string 图层, string 屏幕点击, string 颜色, string 缩放, string 镜像)
            {
                this.块名称    = 块名称;
                this.图层       = 图层;
                this.屏幕点击 = int.Parse(屏幕点击);
                this.颜色       = short.Parse(颜色);
                this.缩放       = bool.Parse(缩放);
                this.镜像       = bool.Parse(镜像);
            }

            //顺序要和构造函数一样
            public override string ToString()
            {
                //string[] strs = new string[] { DynamicJsonConfig.DwgPath,
                //    BlockName, LayerName, _EntOneTwoStr, _ColorStr, _SuofangStr, _JingxiangStr };
                string[] strs = new string[] { 块名称, 图层, 屏幕点击.ToString(), 颜色.ToString(), 缩放.ToString(), 镜像.ToString() };
                return string.Join("\",\"", strs);

            }
        }

        public class asd
        {
            private string[] v;
            private string[] v22222;

            public asd() { }
            public asd(string[] v)
            {
                this.v22222 = new string[] { "{{{}}}" }; /* 这种多行注释的对齐也会对齐
                this.v = new string[] { "{{{}}}" }; */
                this.v      = new string[] { "{{{}}}" };
                //这样  a
                this.v      = new string[] { "{{{}}}" };
            }

            public int My { get; set; }
            public int MyP2asdasdasdasdasty { get; set; }
            public int M4erty { get; set; }

            /// <summary>
            /// 属性值双击显示 Vlax-Put
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void AttributesList_MouseDoubleClick(object sender, MouseEventArgs e)
            {
                this.BeginInvoke(new Action(() =>
                {
                    var text      = AttributesList.Text.Split(" ".ToCharArray()).GetValue(0);
                    CodeText.Text = "(Vlax-Put (Vlax-Ename->Vla-Object (Car (Entsel))) '" + text.ToString() + " 参数)";
                }));
            }
        }

        public static class asd222
        {
            public static string M4erty2 = " {";
            public static string My1 = " {";
            public static int M4erty
            { get; set; }
                  = 1561;
            public static int MyP2asdasdasdasdasty
            {
                get { return 1; }
                set { int aaddasd = value; }
            }
            public static int My { get; set; }
                 = 1561;
        }

        [Flags]//打印的时候可以有名称输出,而不是值输出
        public enum 啊大大
        {
            None   = 5000,   //没有结果   回车耶
            Double = 5001,   //实数      Real
        }

        [Flags]//打印的时候可以有名称输出,而不是值输出
        public enum EnumBufCodefasfasfasf3rfsdfsdgsdgsdgsdgsdgsdg

        {
            // resbuf元素的类型
            None           = 5000, //没有结果   回车耶
            Double         = 5001, //实数      Real
            Point2d        = 5002, //2维点
            Int16          = 5003, //短整数     Short
            #region MyRegion
            Angle          = 5004, //角度
            Text           = 5005, //字符串     String
            ObjectId       = 5006, //实体名称   Ename
            #endregion
            SelectionSet   = 5007, //选择集名   PickSet
            Orientation    = 5008, //方向
            Point3d        = 5009, //3维点
#if true
            Int32          = 5010, //长整数     Long
#endif
            Void           = 5014, //空白符号
            ListBegin      = 5016, //list begin
            ListEnd        = 5017, //list end
            DottedPair     = 5018, //点对
            Nil            = 5019, //nil(空表)
            Dxf0           = 5020, //DXF代码0仅适用于ads_bListldlist
            T_atom         = 5021, //T(原子)
            Resbuf         = 5023, //resbuf
            Modeless       = 5027, //被无模式对话中断
            Other          = 5028,
            // 错误返回代码
            OK             = 5100, //请求成功,用户输入值有效  Norm
            Error          = -5001,//其他一些错误
            Cancel         = -5002,//用户取消请求-Ctl-C
            RejectRequest  = -5003,//AutoCAD拒绝请求-无效
            FailureLink    = -5004,//链接失败-Lisp可能已经死了
            Keyword        = -5005,//从getxxx（）例程返回的关键字
            Inputtruncated = -5008,//输入并不都适合缓冲区
            test           = -156, //     //啊啊啊啊啊"啊啊啊"///啊啊啊啊///啊啊啊啊//啊
            Fsffasfasfa    = test | Inputtruncated
                | Keyword

                | OK,

            Fsffasfasfa2   = test | Inputtruncated
                | Keyword
                | OK
        }
    }


    namespace JoinBox.试验库2222
    {
        public partial class 序列化图元222233
        {
            [CommandMethod("test_Serialize", CommandFlags.Modal | CommandFlags.UsePickSet | CommandFlags.DocExclusiveLock)]
            public static void test_Serialize222()
            {
                Database db = HostApplicationServices.WorkingDatabase;//当前的数据库
                Editor ed = Acap.DocumentManager.MdiActiveDocument.Editor;
                ed.WriteMessage("\n****{惊惊连盒}测试,序列化图元");
                Document doc = Acap.DocumentManager.MdiActiveDocument;

                var ssPsr = ed.SelectImplied();//预选
                if (ssPsr.Status! = PromptStatus.OK)
                {
                    ssPsr = ed.GetSelection();//手选  这里输入al会变成all,无法删除ssget的all关键字
                    if (ssPsr.Status! = PromptStatus.OK)
                    {
                        return;
                    }
                }

                // 调整齐等号要避开这样的,但是注释不避开
                string a1 = "add2//12\"aaa\"as";                      //     //啊啊"bbb"///啊啊=啊"啊///啊啊"啊啊//啊""
                string test2 = "ada//sdad/d/asd/d/a/sd/a///asdas";    //     //啊啊=啊啊啊///啊啊啊啊///啊啊啊啊//啊
                string test3 = "ada//sdad/d/asd/d/a/sd/a///asdas";    //     //啊啊啊啊啊///啊啊啊啊///啊啊啊啊//啊

                //都不避开这样的
                var fc = new asd()
                {
                    My                   = 2,                    //a a a a a a
                    MyP2asdasdasdasdasty = 4,                    //dasdasds
                    M4erty               = 846,                  //gds个
                };
                int[] a = new int[] { 1, 2 };
                var fc2 = new asd(new string[] { "a" }
                    )

                {//assda

                    My                   = 2,                     //a a a a a a
                    MyP2asdasdasdasdasty = 4,                     //dasdasds
                    M4erty               = 846,                   //gds个
                };

                var fc34 = new asd()
                {
                    My                   = 2,                      //a a a a a a
                    MyP2asdasdasdasdasty = 4,                      //dasdasds
                    M4erty               = 846,                    //gds个
                };

                asd222.My = 2;                                    //a a a a a a
                asd222.MyP2asdasdasdasdasty = 4;                  //dasdasds
                asd222.M4erty = 846;                              //gds个=
                db.Action(tr =>
                {
                    foreach (var id in ssPsr.Value.GetObjectIds())
                    {
                        var ent = id.ToEntity(tr);
                        if (ent! = null)
                        {
                            var xmDwgFiler = new XmDwgFiler();
                            ent.DwgOut(xmDwgFiler);
                            var str = JsonConvert.SerializeObject(xmDwgFiler);  //序列化*类转字符串

                            //替换中括号以外的字符串,替换逗号为换行符 https://bbs.csdn.net/topics/370134253
                            str = str.Substring(1, str.Length - 2);
                            str = Regex.Replace(str, @"(?:,)(?![^\[]*?\])", "\r\n");
                            ed.WriteMessage(Environment.NewLine + str);

                            //反序列化*字符串转类
                            //Root = JsonConvert.DeserializeObject<Root>(json);
                        }
                    }
                });
            }
        }

        public partial class 测试fasfaasfasf
        {
            public class UpgradeOpenManaasdsadger : IDisposable //事务分配的接口
            {
                DBObject _obj;
                /// <summary>
                /// 已启用通知
                /// </summary>
                bool _isNotifyEnabled;
                /// <summary>
                /// 已启用写入
                /// </summary>
                bool _isWriteEnabled;
                internal UpgradeOpenManaasdsadger(DBObject obj)
                {
                    _obj = obj;
                    _isNotifyEnabled = _obj.IsNotifyEnabled; //已启用通知
                    _isWriteEnabled = _obj.IsWriteEnabled;   //已启用写入
                    if (_isNotifyEnabled)
                        _obj.UpgradeFromNotify();//打开通知
                    else if (!_isWriteEnabled)
                        _obj.UpgradeOpen();     //打开权限 OpenMode.ForWrite
                }
                public void Dispose()
                {
                    if (_isNotifyEnabled)
                    {
                        _obj.DowngradeToNotify(_isWriteEnabled);//降级通知
                    }
                    else if (!_isWriteEnabled)
                    {
                        _obj.DowngradeOpen();
                    }
                }
            }



            [CommandMethod("test_tasdasdy", CommandFlags.Modal | CommandFlags.Session | CommandFlags.Redraw)]
            public static void JJ_teasdasdasstty()
            {
                Database db = HostApplicationServices.WorkingDatabase;//当前的数据库
                Editor ed = Acap.DocumentManager.MdiActiveDocument.Editor;
                ed.WriteMessage("\n****{惊惊连盒}测试,投影三维图元到某个平面上");

                using (Acap.DocumentManager.MdiActiveDocument.LockDocument())//锁文档 CommandFlags.Session
                {
                    db.Action(tr =>
                    {
                        //三维的线
                        var entity = EntityAdd.AddLineToEntity(Point3d.Origin, new Point3d(1, 1, 1));
                        entity.ColorIndex = 1;
                        var lineId = tr.AddEntityToMsPs(db, entity);

                        var ids22 = new List<ObjectId>() { lineId };
                        var cus = tr.Entitys2Plane(ids);
                        foreach (var item in cus)
                        {
                            item.ColorIndex = 2;
                            tr.AddEntityToMsPs(db, item);
                        }
                    });
                }
            }

            //测试单行文本的修改方式
            [CommandMethod("test_msadasdd", CommandFlags.Modal)]
            public static void JJ_mdasdasd()
            {
                Database db = HostApplicationServices.WorkingDatabase;//当前的数据库
                Editor ed = Acap.DocumentManager.MdiActiveDocument.Editor;
                var psr1 = ed.GetSelection();//手选
                if (psr1.Status! = PromptStatus.OK)
                {
                    return;
                }
                db.Action(tr =>
                {
                    foreach (var item in psr1.Value.GetObjectIds())
                    {
                        var ent = item.ToEntity(tr);
                        if (ent is DBText dbt)
                        {
                            dbt.UpgradeOpen();

                            if (dbt.Justify == Attachment.Get("左"))
                            {
                                dbt.Position = Point3d.Origin;//只有左对齐才能设置
                            }
                            else if (dbt.Justify == Attachment.Get("铺满") ||
                                     dbt.Justify == Attachment.Get("调整"))
                            {
                                var ps = dbt.Position;
                                dbt.Position = Point3d.Origin;
                                dbt.AlignmentPoint = new Point3d(dbt.AlignmentPoint.X - ps.X,
                                                                 dbt.AlignmentPoint.Y - ps.Y,
                                                                 dbt.AlignmentPoint.Z - ps.Z);
                            }
                            else
                            {
                                dbt.AlignmentPoint = Point3d.Origin;
                            }
                            dbt.DowngradeOpen();
                            dbt.Dispose();
                        }
                    }
                });
            }


            //[CommandMethod("ceshishiwu", CommandFlags.Modal | CommandFlags.Session | CommandFlags.Redraw)]
            //public static void JJ_ceshishiwu()
            //{
            //    ObjectId line1 = new ObjectId();
            //    using (line1.UpgradeOpenAndRun())
            //    {

            //    }
            //}

            [CommandMethod("cslu", CommandFlags.Modal | CommandFlags.Session | CommandFlags.Redraw)]
            public static void JJ_cslu()
            {
                Database db = HostApplicationServices.WorkingDatabase;//当前的数据库
                Editor ed = Acap.DocumentManager.MdiActiveDocument.Editor;
                db.Action(tr =>
                {
                    // tr.AddTextStyle(db, "SD_LUCIDIA", "Lucida Sans.TTF");//TTF要大写
                    db.TraverseTextStyleTable(tr, tstr =>
                    {
                        if (tstr.Name == "SD_LUCID按时大大IA")
                        {

                        }
                        return false;
                    });
                });
            }


        }
    }




    //[Serializable]
    //[SerializableAttribute]
    //[DataContract]设置某些可以序列化,成员用此标记[DataMember] https://www.cnblogs.com/maitian-lf/p/3670570.html
    //所有属性位置都不要改动位置,因为涉及序列化
    namespace JoinBox
    {
        [DataContract]
        public class XmDwgFiler22222 : DwgFiler
        {
            [DataMember]
#if NET35
        public int m_Position;
#else
            public long m_Position;
#endif
            [DataMember]
            public FilerType m_FilerType;
            [DataMember]
            public ErrorStatus m_FilerStatus;
            [DataMember]
            public List<IntPtr> AddressList { get; set; }
            [DataMember]
            public int AddressListPt = 0;
            [DataMember]
            public List<byte[]> BinaryChunkList { get; set; }
            [DataMember]
            public int BinaryChunkListPt = 0;
            [DataMember]
            public List<bool> BooleanList { get; set; }
            [DataMember]
            public int BooleanListPt = 0;
            [DataMember]
            public List<byte> ByteList { get; set; }
            [DataMember]
            public int ByteListPt = 0;

            [DataMember]
            public List<byte[]> BytesList { get; set; }
            [DataMember]
            public int BytesListPt = 0;
            [DataMember]
            public List<double> DoubleList { get; set; }
            [DataMember]
            public int DoubleListPt = 0;
            [DataMember]
            public List<Handle> HandleList { get; set; }
            [DataMember]
            public int HandleListPt = 0;

            public List<ObjectId> HardOwnershipIdList { get; set; }
            [DataMember]
            public int HardOwnershipIdListPt = 0;

            public List<ObjectId> HardPointerIdList { get; set; }
            [DataMember]
            public int HardPointerIdListPt = 0;
            [DataMember]
            public List<short> Int16List { get; set; }
            [DataMember]
            public int Int16ListPt = 0;
            [DataMember]
            public List<int> Int32List { get; set; }
            [DataMember]
            public int Int32ListPt = 0;
#if !NET35
            [DataMember]
            public List<long> Int64List { get; set; }
            [DataMember]
            public int Int64ListPt = 0;
#endif
            [DataMember]
            public List<Point2d> Point2dList { get; set; }
            [DataMember]
            public int Point2dListPt = 0;
            [DataMember]
            public List<Point3d> Point3dList { get; set; }
            [DataMember]
            public int Point3dListPt = 0;
            [DataMember]
            public List<Scale3d> Scale3dList { get; set; }
            [DataMember]
            public int Scale3dListPt = 0;

            public List<ObjectId> SoftOwnershipIdList { get; set; }
            [DataMember]
            public int SoftOwnershipIdListPt = 0;

            public List<ObjectId> SoftPointerIdList { get; set; }
            [DataMember]
            public int SoftPointerIdListPt = 0;
            [DataMember]
            public List<string> StringList { get; set; }
            [DataMember]
            public int StringListPt = 0;
            [DataMember]
            public List<ushort> Uint16List { get; set; }
            [DataMember]
            public int uint16ListPt = 0;
            [DataMember]
            public List<uint> Uint32List { get; set; }
            [DataMember]
            public int uint32ListPt = 0;
#if !NET35
            [DataMember]
            public List<ulong> Uint64List { get; set; }
            [DataMember]
            public int uint64ListPt = 0;
#endif
            [DataMember]
            public List<Vector2d> Vector2dList { get; set; }
            [DataMember]
            public int Vector2dListPt = 0;
            [DataMember]
            public List<Vector3d> Vector3dList { get; set; }
            [DataMember]
            public int Vector3dListPt = 0;


            /// <summary>
            /// 序列化cad图元
            /// 数据库的内容和实际展示的不一定相同,所以序列化可以看到没封装处理的图元.
            /// </summary>
            public XmDwgFiler22222()
            {
                string asdadsadasdd = "a{\"\""; /*a=aa*/
                /*a"=a"a*/
                int a               = 0;/*a"=a"
             *
             *a*/
                string asdas2       = "a*/s/*d=a\"s";/*a"=aa*/
                string asdasd3      = "asda\"s";
                string asdasd       = "asda\"s";/*a"a       //这样要直接忽略掉
                                             a*/  //这样要直接忽略掉
                string asdasd2      = "asda\"s";
                /*a"a"a*/
                /*
                在自定义实体类函数中添加了读函数（assertReadEnabled）和写函数（assertWriteEnabled），
                函数说明：
                断言对象当前                          =状态一定被读方式打开，该函数多用于自定义实体的属性操作函数中"*/
                string aaaaaa       = "asdasd"; // /*只需要找到第一个,不然就是失效的.
                m_Position          = 0;
                m_FilerType         = FilerType.CopyFiler;//a
                m_FilerStatus       = ErrorStatus.OK;
                AddressList         = new List<IntPtr>();

                BinaryChunkList     = new List<byte[]>();
                BooleanList         = new List<bool>();
                ByteList            = new List<byte>();
                BytesList           = new List<byte[]>();
                DoubleList          = new List<double>();
                HandleList          = new List<Handle>();
                HardOwnershipIdList = new List<ObjectId>();
                HardPointerIdList   = new List<ObjectId>();
                Int16List           = new List<short>();
                Int32List           = new List<int>();
#if !NET35
                Int64List           = new List<long>();
#endif
                Point2dList         = new List<Point2d>();
                Point3dList         = new List<Point3d>();
                Scale3dList         = new List<Scale3d>();
                SoftOwnershipIdList = new List<ObjectId>();
                SoftPointerIdList   = new List<ObjectId>();
                StringList          = new List<string>();
                Uint16List          = new List<ushort>();
                Uint32List          = new List<uint>();
#if !NET35
                Uint64List          = new List<ulong>();
#endif
                Vector2dList        = new List<Vector2d>();
                Vector3dList        = new List<Vector3d>();
            }

            #region rerererere
#if NET35
        public override int Position        => m_Position;
#else
            public override long Position => m_Position;
#endif
            public override FilerType FilerType
            {
                get
                {
                    return this.m_FilerType;
                }
            }

            public override ErrorStatus FilerStatus
            {
                get
                {
                    return m_FilerStatus;
                }
                set
                {
                    m_FilerStatus = value;
                }
            }

            public override IntPtr ReadAddress()
            {
                if (AddressList.Count() == 0)
                {
                    return new IntPtr();
                }
                return AddressList[AddressListPt++];
            }

            public override byte[] ReadBinaryChunk()
            {
                if (BinaryChunkList.Count() == 0)
                {
                    return null;
                }
                return BinaryChunkList[BinaryChunkListPt++];
            }

            public override bool ReadBoolean()
            {
                if (BooleanList.Count() == 0)
                {
                    return false;
                }
                return BooleanList[BooleanListPt++];
            }

            public override byte ReadByte()
            {
                if (ByteList.Count() == 0)
                {
                    return 0;
                }
                return ByteList[ByteListPt++];
            }

            public override void ReadBytes(byte[] value)
            {
                if (ByteList.Count() == 0)
                {
                    return;
                }
                value = new byte[BytesList[BytesListPt].Length];
                BytesList[BytesListPt++].CopyTo(value, 0);
            }

            public override double ReadDouble()
            {
                if (DoubleList.Count() == 0)
                {
                    return 0;
                }
                return DoubleList[DoubleListPt++];
            }

            public override Handle ReadHandle()
            {
                if (HandleList.Count() == 0)
                {
                    return new Handle();
                }
                return HandleList[HandleListPt++];
            }

            public override ObjectId ReadHardOwnershipId()
            {
                if (HardOwnershipIdList.Count() == 0)
                {
                    return new ObjectId();
                }
                return HardOwnershipIdList[HardOwnershipIdListPt++];
            }

            public override ObjectId ReadHardPointerId()
            {
                if (HardPointerIdList.Count() == 0)
                {
                    return new ObjectId();
                }
                return HardPointerIdList[HardPointerIdListPt++];
            }

            public override short ReadInt16()
            {
                if (Int16List.Count() == 0)
                {
                    return 0;
                }
                return Int16List[Int16ListPt++];
            }

            public override int ReadInt32()
            {
                if (Int32List.Count() == 0)
                {
                    return 0;
                }
                return Int32List[Int32ListPt++];
            }

#if !NET35
            public override long ReadInt64()
            {
                if (Int64List.Count() == 0)
                {
                    return 0;
                }
                return Int64List[Int64ListPt++];
            }
#endif

            public override Point2d ReadPoint2d()
            {
                if (Point2dList.Count() == 0)
                {
                    return new Point2d();
                }
                return Point2dList[Point2dListPt++];
            }

            public override Point3d ReadPoint3d()
            {
                if (Point3dList.Count() == 0)
                {
                    return new Point3d();
                }
                return Point3dList[Point3dListPt++];
            }

            public override Scale3d ReadScale3d()
            {
                if (Scale3dList.Count() == 0)
                {
                    return new Scale3d();
                }
                return Scale3dList[Scale3dListPt++];
            }

            public override ObjectId ReadSoftOwnershipId()
            {
                if (SoftOwnershipIdList.Count() == 0)
                {
                    return new ObjectId();
                }
                return SoftOwnershipIdList[SoftOwnershipIdListPt++];
            }

            public override ObjectId ReadSoftPointerId()
            {
                if (SoftPointerIdList.Count() == 0)
                {
                    return new ObjectId();
                }
                return SoftPointerIdList[SoftPointerIdListPt++];
            }

            public override string ReadString()
            {
                if (StringList.Count() == 0)
                {
                    return null;
                }
                return StringList[StringListPt++];
            }

            public override ushort ReadUInt16()
            {
                if (Uint16List.Count() == 0)
                {
                    return 0;
                }
                return Uint16List[uint16ListPt++];
            }

            public override uint ReadUInt32()
            {
                if (Uint32List.Count() == 0)
                {
                    return 0;
                }
                return Uint32List[uint32ListPt++];
            }

#if !NET35
            public override ulong ReadUInt64()
            {
                if (Uint64List.Count() == 0)
                {
                    return 0;
                }
                return Uint64List[uint64ListPt++];
            }
#endif

            public override Vector2d ReadVector2d()
            {
                if (Vector2dList.Count() == 0)
                {
                    return new Vector2d();
                }
                return Vector2dList[Vector2dListPt++];
            }

            public override Vector3d ReadVector3d()
            {
                if (Vector3dList.Count() == 0)
                {
                    return new Vector3d();
                }
                return Vector3dList[Vector3dListPt++];
            }

            #endregion
            public override void ResetFilerStatus()
            {
                AddressList.Clear();
                AddressListPt = 0;
                BinaryChunkList.Clear();
                BinaryChunkListPt = 0;
                BooleanList.Clear();
                BooleanListPt = 0;
                ByteList.Clear();
                ByteListPt = 0;
                BytesList.Clear();
                BytesListPt = 0;
                DoubleList.Clear();
                DoubleListPt = 0;
                HandleList.Clear();
                HandleListPt = 0;
                HardOwnershipIdList.Clear();
                HardOwnershipIdListPt = 0;
                HardPointerIdList.Clear();
                HardPointerIdListPt = 0;
                Int16List.Clear();
                Int16ListPt = 0;
                Int32List.Clear();
                Int32ListPt = 0;
#if !NET35
                Int64List.Clear();
                Int64ListPt = 0;
#endif
                Point2dList.Clear();
                Point2dListPt = 0;
                Point3dList.Clear();
                Point3dListPt = 0;
                Scale3dList.Clear();
                Scale3dListPt = 0;
                SoftOwnershipIdList.Clear();
                SoftOwnershipIdListPt = 0;
                SoftPointerIdList.Clear();
                SoftPointerIdListPt = 0;
                StringList.Clear();
                StringListPt = 0;
                Uint16List.Clear();
                uint16ListPt = 0;
                Uint32List.Clear();
                uint32ListPt = 0;
#if !NET35
                Uint64List.Clear();
                uint64ListPt = 0;
#endif
                Vector2dList.Clear();
                Vector2dListPt = 0;
                Vector3dList.Clear();
                Vector3dListPt = 0;

                m_FilerType = FilerType.CopyFiler;
            }

            public override void Seek(
#if AC2008 || AC2009
        int
#else
        long
#endif
         offset, int method)
            {
                Editor ed = Acap.DocumentManager.MdiActiveDocument.Editor;
                ed.WriteMessage(MethodInfo.GetCurrentMethod().Name + " = " + " \n ");
            }

            public override void WriteAddress(IntPtr value)
            {
                AddressList.Add(value);
            }

            public override void WriteBinaryChunk(byte[] chunk)
            {
                BinaryChunkList.Add(chunk);
            }

            public override void WriteBoolean(bool value)
            {
                BooleanList.Add(value);
            }

            public override void WriteByte(byte value)
            {
                ByteList.Add(value);
            }

            public override void WriteBytes(byte[] value)
            {
                BytesList.Add(value);
            }

            public override void WriteDouble(double value)
            {
                DoubleList.Add(value);
            }

            public override void WriteHandle(Handle handle)
            {
                HandleList.Add(handle);
            }

            public override void WriteHardOwnershipId(ObjectId value)
            {
                HardOwnershipIdList.Add(value);
            }

            public override void WriteHardPointerId(ObjectId value)
            {
                HardPointerIdList.Add(value);
            }

            public override void WriteInt16(short value)
            {
                Int16List.Add(value);
            }

            public override void WriteInt32(int value)
            {
                Int32List.Add(value);
            }

#if !NET35
            public override void WriteInt64(long value)
            {
                Int64List.Add(value);
            }
#endif
            public override void WritePoint2d(Point2d value)
            {
                Point2dList.Add(value);
            }

            public override void WritePoint3d(Point3d value)
            {
                Point3dList.Add(value);
            }

            public override void WriteScale3d(Scale3d value)
            {
                Scale3dList.Add(value);
            }

            public override void WriteSoftOwnershipId(ObjectId value)
            {
                SoftOwnershipIdList.Add(value);
            }

            public override void WriteSoftPointerId(ObjectId value)
            {
                SoftPointerIdList.Add(value);
            }

            public override void WriteString(string value)
            {
                StringList.Add(value);
            }

            public override void WriteUInt16(ushort value)
            {
                Uint16List.Add(value);
            }

            public override void WriteUInt32(uint value)
            {
                Uint32List.Add(value);
            }

#if !NET35
            public override void WriteUInt64(ulong value)
            {
                Uint64List.Add(value);
            }
#endif

            public override void WriteVector2d(Vector2d value)
            {
                Vector2dList.Add(value);
            }

            public override void WriteVector3d(Vector3d value)
            {
                Vector3dList.Add(value);
            }

#if false
        public override string ToString()
        {
            int ptCount                     =
                AddressListPt +
                BinaryChunkListPt +
                BooleanListPt +
                ByteListPt +
                BytesListPt +
                DoubleListPt +
                HandleListPt +
                HardOwnershipIdListPt +
                HardPointerIdListPt +
                Int16ListPt +
                Int32ListPt +
#if !NET35
                Int64ListPt +
#endif
                Point2dListPt +
                Point3dListPt +
                Scale3dListPt +
                SoftOwnershipIdListPt +
                SoftPointerIdListPt +
                StringListPt +
                uint16ListPt +
                uint32ListPt +
#if !NET35
                uint64ListPt +
#endif
                Vector2dListPt +
                Vector3dListPt;

                int ltCount                 =
                AddressList.Count() +
                BinaryChunkList.Count() +
                BooleanList.Count() +
                ByteList.Count() +
                BytesList.Count() +
                DoubleList.Count() +
                HandleList.Count() +
                HardOwnershipIdList.Count() +
                HardPointerIdList.Count() +
                Int16List.Count() +
                Int32List.Count() +
#if !NET35
                Int64List.Count() +
#endif
                Point2dList.Count() +
                Point3dList.Count() +
                Scale3dList.Count() +
                SoftOwnershipIdList.Count() +
                SoftPointerIdList.Count() +
                StringList.Count() +
                Uint16List.Count() +
                Uint32List.Count() +
#if !NET35
                Uint64List.Count() +
#endif
                Vector2dList.Count() +
                Vector3dList.Count();

            return
                "\n" + ptCount.ToString() + " DataIn" +
                "\n" + ltCount.ToString() + " DataOut";
        }
#endif
        }
    }